package com.realbrand.net.realbrandpay.ui.activity.wallet.personer;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.realbrand.net.realbrandpay.R;
import com.realbrand.net.realbrandpay.base.BaseActivity;
import com.realbrand.net.realbrandpay.ui.activity.wallet.set.VerifyPhoneCodeActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/7/10.
 */

public class BoundPhoneActivity extends BaseActivity {
    @BindView(R.id.phonecode_toolbar)
    Toolbar phonecodeToolbar;
    @BindView(R.id.boundPhone_bt_changePhone)
    Button boundPhoneBtChangePhone;
    @BindView(R.id.boundPhone_tv_mobile)
    TextView boundPhoneTvMobile;

    public static String BOUND_PHONE = "boundPhone";
    public static String PHONE_CODE = "phone";

    //用户绑定的手机号码
    private String UserMobile;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutId());
        ButterKnife.bind(this);
        phonecodeToolbar.setTitle("");
        phonecodeToolbar.setNavigationIcon(R.drawable.ic_back);
        setSupportActionBar(phonecodeToolbar);
        phonecodeToolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        //获取用户上次绑定的手机号码
        Intent intent = getIntent();
        UserMobile = intent.getStringExtra("mobile");
        boundPhoneTvMobile.setText(UserMobile);
        setOnClick();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.phonecode_activity;
    }

    @Override
    protected void setOnClick() {
        boundPhoneBtChangePhone.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            //点击修改手机号
            case R.id.boundPhone_bt_changePhone:
                Intent intent = new Intent(this, VerifyPhoneCodeActivity.class);
                intent.putExtra("mobile",UserMobile);
                startActivity(intent);
                finish();
                break;
        }
    }
}
